<template>
  <div id="overPayment">
    <div style="text-align: center">
      <h1>支付完成</h1>
      <van-button @click="toOrderList">返回到订单页面</van-button>
    </div>
  </div>
</template>

<script>
import {updateOrder} from "@/api/order/orderList";

export default {
  data() {
    return {
      //订单ID
      orderId: this.$route.query.out_trade_no,
      //支付方式
      method: this.$route.query.method
    }
  },
  created() {
    console.log(this.$route.query.out_trade_no)
    if (this.method === 'alipay.trade.wap.pay.return') {
      console.log('支付宝支付')
      updateOrder(this.orderId).then(res => {
        console.log(res)
      })
    } else  {
      console.log('微信支付')
    }
  },

methods: {
  toOrderList()
  {
    this.$router.push('/orderList')
  }
}
}
</script>

<style>
#overPayment {
  width: 100%;
  height: 100vh;
  overflow: auto; /* 开启滚动条 */
  background: #F3FCFF;
}

</style>